package org.jeecg.modules.rooms.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.Enum.ResultCode;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.rooms.entity.CesRoomLayoutMemberPrice;
import org.jeecg.modules.rooms.entity.CesRoomPricePlan;
import org.jeecg.modules.rooms.service.CesRoomLayoutMemberPriceServiceImpl;
import org.jeecg.modules.rooms.service.CesRoomPricePlanServiceImpl;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fendo
 * @since 2023-03-02
 */
@RestController
@RequestMapping("/rooms/roomPricePlan")
@Api(tags="ces_room_price_plan")
@Slf4j
public class CesRoomPricePlanController  extends JeecgController<CesRoomPricePlan, CesRoomPricePlanServiceImpl> {

    @Resource
    private CesRoomPricePlanServiceImpl roomPricePlanService;

    @ApiOperation(value="获取当前酒店的房价方案", notes="获取当前酒店的房价方案")
    @PostMapping(value = "/getRoomPlans/{hotelId}")
    public Result getRoomPlans(@PathVariable String hotelId){
        if(StringUtils.isBlank(hotelId)){
            return Result.error(ResultCode.PARAM_MISS);
        }
        try{
            return  roomPricePlanService.getRoomPlans(hotelId);
        }catch (Exception e){
            return Result.error(e.getMessage());
        }
    }

}

